package cxg.cloud.controller;

import cxg.cloud.entity.DeptPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("/customer")
public class CustomerTestController {

    private static final String REST_URL_PREFIX = "http://my-all-cloud-provider";

    @Autowired
    private RestTemplate restTemplate;

    /**
     * 获取单个信息
     * @param deptId
     * @return
     */
    @GetMapping("/get")
    public DeptPO getById(@RequestParam(value = "deptId") Integer deptId){
        return restTemplate.getForObject(REST_URL_PREFIX + "/dept/get?deptId="+ deptId, DeptPO.class);
    }

}
